

#include	"public.h"




#ifndef MAX
#define MAX(X, Y) (((X) > (Y)) ? (X) :(Y))
#endif

#ifndef MIN
#define MIN(X, Y) (((X) < (Y)) ? (X) :(Y))
#endif


#define	MAX_CHAR_BUF	1024

/* define the number of seconds of one day */
#define	PUB_SECONDS_PER_DAY	86400

/* define the number of days since 1900-01-01 to 1970-01-01 */
#define PUB_DAYS_70_YEARS	25567

/* define the max length of error_message */
#define	PUB_MAX_MSG_LENGTH	250


// Added by ZJH in SZ 	00.09.28
#define	STAT_MODE_DEF_ABS	1
#define STAT_MODE_DEF_VALUE	0
// End of Added

/*
** Defines structure where row data is bound.
*/

extern	void pub_error (
	char		*msg
);
extern  KEYID_TYPE * pub_keyid_to_struct (
        char            *keyid
);
extern char * pub_struct_to_keyid (
        KEYID_TYPE      keyid_type
);
extern short    frame_dispose (
        char            *frame_ptr,
        int             frame_size,
        char            **send_ptr,
        int             *send_size,
        char            **remain_ptr,
        int             *remain_size
);
extern int dnet_send_message_frame(
		system_net_info &net_info, 
		int report_type, app_buf_head &ah, 
		char *result_buf, 
		int result_len);

extern char * pub_binary_to_string (
        char            *bin_mem,
        int             bin_length
);
extern int get_large_report_buffer (
        char            *old_buffer,
        unsigned int    old_length,
        char            end_flag,
        unsigned int    send_length,
        char            *send_buffer,
        unsigned int    *new_length,
        char            **new_buffer
);
extern int  exists_occur_time (
	char			*table_name,
	char			*time_str
);
extern int  pub_execute_cmd (
	char			*sql_str,
	short			*error_no,
	char			*error_message
);
extern int  pub_execute_cmd_without_commit (
	char			*sql_str,
	short			*error_no,
	char			*error_message
);
extern char * translate_time_to_ora_string (
	int			seconds
);


// Added by ZJH in SZ 	00.09.29
extern unsigned char	get_statistic_mode  (
);
// End of Added

#ifdef	_DUPLICAT
extern void send_sql_to_duplicat (
char		*sql_str
);
#endif


